import { createI18n } from 'vue-i18n'

import zh from './zh'
import en from './en'
import { getLang } from '@/utils/localstorage'

const i18n = createI18n({
  legacy: false,
  locale: getLang() ?? '',
  globalInjection: true,
  messages: {
    zh,
    en
  }
})

export default i18n
